﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎登录后台管理系统</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/jquery.js"></script>
<script src="js/cloud.js" type="text/javascript"></script>
<script src="./js/placeholderForInput.js" type="text/javascript" ></script>
<script language="javascript">
	$(function() {
		$('.loginbox').css({
			'position' : 'absolute',
			'left' : ($(window).width() - 692) / 2
		});
		$(window).resize(function() {
			$('.loginbox').css({
				'position' : 'absolute',
				'left' : ($(window).width() - 692) / 2
			});
		})
	});
	
	
        $(function(){
        	$("input[type='text']").nc_placeholder();
            //得到焦点
            $("#password").focus(function(){
                $("#left_hand").animate({
                    left: "150",
                    top: " -38"
                },{step: function(){
                    if(parseInt($("#left_hand").css("left"))>140){
                        $("#left_hand").attr("class","left_hand");
                    }
                }}, 2000);
                $("#right_hand").animate({
                    right: "-64",
                    top: "-38px"
                },{step: function(){
                    if(parseInt($("#right_hand").css("right"))> -70){
                        $("#right_hand").attr("class","right_hand");
                    }
                }}, 2000);
            });
            
            //失去焦点
            $("#password").blur(function(){
                $("#left_hand").attr("class","initial_left_hand");
                $("#left_hand").attr("style","left:100px;top:-12px;");
                $("#right_hand").attr("class","initial_right_hand");
                $("#right_hand").attr("style","right:-112px;top:-12px");
            });
            
            $(".loginbtn").click(function(){
    			login();
    		});
            
            //注册回车键事件
            document.onkeydown = function(e){ 
	    	    var ev = document.all ? window.event : e;
	    	    if(ev.keyCode==13) {
	    	    	login();
	    	    }
	    	}
        });
    	
    	//登录
    	function login(){
    		var username = $("input[name='username']").val();
            var password = $("input[name='password']").val();
            var flag = true;
            if(username==""){
                $("#confirmMsg").html("<font color=red>用户名不能为空！</font>");
                $(".loginContent").css("height", 240);
                flag = false;
                return;
            }
            
            if(password==""){
               $("#confirmMsg").html("<font color=red>密码不能为空！</font>");
               $(".loginContent").css("height", 240);
               flag = false;
               return;
            } 
            
            if(flag){
    	       	$("#loginLoading").css("display","block");
    	       	$(".loginContent").css("height", 240);
    	           $.post("../adminUser/temp/login.do",{username:username,password:password},
    			     function(jsonData){
    	           	   $("#loginLoading").css("display","none");
    				       if(jsonData.code=="00"){
    				    	   window.location.href='main.jsp';
    				       }else{
    				           $("#confirmMsg").html("<font color=red>"+jsonData.msg+"</font>");
    				       }
    		    },"json");
            }
    	}
    </script>
</head>
<body style="background-color:#1c77ac; background-image:url(images/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">
    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  
    <div class="logintop">    
	    <span>欢迎登录后台管理界面平台</span>    
	    <ul>
	    <li><a href="javascript:void(0)">回首页</a></li>
	    <li><a href="javascript:void(0)">帮助</a></li>
	    <li><a href="javascript:void(0)">关于</a></li>
	    </ul>    
    </div>
    
    <div class="loginbody">
	    <span class="systemlogo"></span> 
	    <div class="loginbox">
		    <ul>
			    <li><input name="username" type="text" class="loginuser" value="admin" onclick="JavaScript:this.value=''"/></li>
			    <li><input name="password" type="password" class="loginpwd" value="" onclick="JavaScript:this.value=''"/></li>
			    <li>
				    <input type="button" class="loginbtn" value="登录"   />
				    <label><input name="" type="checkbox" value="" checked="checked" />记住密码</label>
				    <label><a href="javascript:void(0)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></label><br/>
				    <span id="loginLoading" style="display:none"><img src="images/loading.gif" /></span>
				    <span id="confirmMsg"></span>
			    </li>
		    </ul>
	    </div>
    </div>
    <div class="loginbm">版权所有  2017 <a href="javascript:void(0)">fastOA-lsflu@126.com</a> 内部管理系统</div>
</body>

</html>
